package com.ruoyi.commission.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.commission.mapper.AmCommissionMapper;
import com.ruoyi.commission.domain.AmCommission;
import com.ruoyi.commission.service.IAmCommissionService;

/**
 * 佣金占比Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-28
 */
@Service
public class AmCommissionServiceImpl implements IAmCommissionService 
{
    @Autowired
    private AmCommissionMapper amCommissionMapper;

    /**
     * 查询佣金占比
     * 
     * @param id 佣金占比ID
     * @return 佣金占比
     */
    @Override
    public AmCommission selectAmCommissionById(Long id)
    {
        return amCommissionMapper.selectAmCommissionById(id);
    }

    /**
     * 查询佣金占比列表
     * 
     * @param amCommission 佣金占比
     * @return 佣金占比
     */
    @Override
    public List<AmCommission> selectAmCommissionList(AmCommission amCommission)
    {
        return amCommissionMapper.selectAmCommissionList(amCommission);
    }

    /**
     * 新增佣金占比
     * 
     * @param amCommission 佣金占比
     * @return 结果
     */
    @Override
    public int insertAmCommission(AmCommission amCommission)
    {
        amCommission.setCreateTime(DateUtils.getNowDate());
        return amCommissionMapper.insertAmCommission(amCommission);
    }

    /**
     * 修改佣金占比
     * 
     * @param amCommission 佣金占比
     * @return 结果
     */
    @Override
    public int updateAmCommission(AmCommission amCommission)
    {
        return amCommissionMapper.updateAmCommission(amCommission);
    }

    /**
     * 批量删除佣金占比
     * 
     * @param ids 需要删除的佣金占比ID
     * @return 结果
     */
    @Override
    public int deleteAmCommissionByIds(Long[] ids)
    {
        return amCommissionMapper.deleteAmCommissionByIds(ids);
    }

    /**
     * 删除佣金占比信息
     * 
     * @param id 佣金占比ID
     * @return 结果
     */
    @Override
    public int deleteAmCommissionById(Long id)
    {
        return amCommissionMapper.deleteAmCommissionById(id);
    }
}
